package com.hgkj.cloud.base.service.impl;

import com.hgkj.cloud.base.common.PageInfo;
import com.hgkj.cloud.base.dao.SysTablePackageMapper;
import com.hgkj.cloud.base.domain.SysTablePackage;
import com.hgkj.cloud.base.service.SysTablePackageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SysTablePackageServiceImpl implements SysTablePackageService {

    @Autowired
    private SysTablePackageMapper sysTablePackageMapper;

    @Override
    public int deleteByPrimaryKey(String uuid) {
        return sysTablePackageMapper.delTablePackage(uuid);
    }

    @Override
    public int insert(SysTablePackage record) {
        return sysTablePackageMapper.insert(record);
    }

    @Override
    public int insertSelective(SysTablePackage record) {
        return sysTablePackageMapper.insertSelective(record);
    }

    @Override
    public SysTablePackage selectByPrimaryKey(String uuid) {
        return sysTablePackageMapper.selectByPrimaryKey(uuid);
    }

    @Override
    public int updateByPrimaryKeySelective(SysTablePackage record) {
        return sysTablePackageMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(SysTablePackage record) {
        return sysTablePackageMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<SysTablePackage> listAllPackages(PageInfo pi, Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return sysTablePackageMapper.listAllPackages(map);
    }

    @Override
    public Long findAllPackagesCount(Map<String, Object> map) {
        return sysTablePackageMapper.findAllPackagesCount(map);
    }

    @Override
    public int delTablePackage(String uuid) {
        return sysTablePackageMapper.delTablePackage(uuid);
    }

    @Override
    public SysTablePackage findPackageByName(String name) {
        return sysTablePackageMapper.findPackageByName(name);
    }
}
